package com.example.eback.dao;

import com.example.eback.entity.UpLoadFile;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;


public interface FilesDAO extends JpaRepository<UpLoadFile,Integer> {

    UpLoadFile findById(int id);
//    @Modifying
//    @Query(value = "INSERT INTO uploaded_files (id, user_id, file_name) VALUES (:id, :userName, :userPassword)", nativeQuery = true)
//    void save(File currentFile);

    UpLoadFile findByUserIdAndFileUrl(int id,String file_url);
    List<UpLoadFile> findAllByPid(int pid);
    UpLoadFile findByUserIdAndId(int userId,int id);
    UpLoadFile findByUserIdAndIdAndPid(int userId,int id,int pid);
    List<UpLoadFile> findAllByPidAndUserId(int pid,int userId);

}

